[PATCH] Use dbus-run-session to run D-Bus tests instead of dbus-launch
authorPino Toscano <toscano.pino@tiscali.it>
Sun, 23 Nov 2025 09:45:27 +0000 (10:45 +0100)
committerPeter Michael Green <plugwash@raspbian.org>
Sun, 8 Feb 2026 01:59:21 +0000 (01:59 +0000)
dbus-run-session spawns a session that gets terminated automatically
after the execution of the command. It is a simpler way compared to
dbus-launch, which relies on the X11 tolaunching (which would explain
why it is not used on macOS, as the comment says).

Hence, use dbus-run-session instead of dbus-launch to run each D-Bus
test. Keep the existing macOS behaviour as-is for now, adding a comment
to test using dbus-run-session in the future.

Gbp-Pq: Name upstream_Use-dbus-run-session-to-run-D-Bus-tests-instead-of-d.patch

tests/CMakeLists.txt

index a39863a4507096008d5c1846518905dfaa1f06aa..f6cfabd91d9090e02fdb00149072df483eda9949 100644 (file)
@@ -64,9 +64,10 @@ function(qcoro_add_dbus_test _name)
     target_compile_definitions(test-${_name} PRIVATE TESTDBUSSERVER_EXECUTABLE=\"$<TARGET_FILE:testdbusserver>\")
     if (APPLE)
         # On MacOS dbus-launch doesn't work, so we rely on the session dbus running
+        # TODO: check whether dbus-run-session works
         add_test(NAME test-${_name} COMMAND test-${_name})
     else()
-        add_test(NAME test-${_name} COMMAND dbus-launch $<TARGET_FILE:test-${_name}>)
+        add_test(NAME test-${_name} COMMAND dbus-run-session $<TARGET_FILE:test-${_name}>)
     endif()
     _enable_supressions(${_name})
 endfunction()